<?php
class Pageley_Basic_Domain_Address extends Pageley_Domain_AbstractCompositeValue {
    public function __construct($line1, $line2, $city, $postalCode) {
		$factory = Pageley_Config::getInstance();
        parent::__construct(new Pageley_Util_ArrayMap(array(
                "line1" => $line1,
                "line2" => $line2,
                "city" => $city,
                "postalCode" => $postalCode
            )), $factory->valueOf("attribute.address"));
    }

    public static function valueOf($properties) {
        return new Pageley_Basic_Domain_Address(
           $properties->get("line1"),
           $properties->get("line2"),
           $properties->get("city"),
           $properties->get("postalCode"));
    }
}